import java.util.ArrayList;

import denemePackage.AbstractPerson;
import denemePackage.Person;
import denemePackage.Teacher;


public class Demo {

	public static void main(String[] args) {
	
		//AbstractPerson a = new AbstractPerson();
		
		Person p1 = new Person();
		p1.setName("ali");
		p1.setSurname("yilmaz");
		
		Teacher t1 = new Teacher();
		t1.setName("mehmet");
		t1.setSurname("aslan");
		
		Person p2 = new Person();
		p2.setName("ahmet");
		p2.setSurname("yilmaz");
		

		Teacher t2 = new Teacher();
		t2.setName("faruk");
		t2.setSurname("aslan");
		
		Person x = new Teacher();
		Teacher t = (Teacher)new Person();
		
		ArrayList<AbstractPerson> list = new ArrayList<AbstractPerson>();
		list.add(p1);
		list.add(t1);
		list.add(p2);
		list.add(t2);
		
		for ( int i=0; i<list.size(); i++ ) {
			
			AbstractPerson a = list.get(i);
			System.out.println(a.getSpecialName());
		}
	}
	
}
